class Matrix {
    m;
    constructor(matrix) {
        this.m = matrix;
    }

    /**
     * 获取矩阵行数
     * @returns {*}
     */
    get rowsNum() {
        return this.m.length;
    }

    /**
     * 获取矩阵列数
     * @returns {*}
     */
    get colsNum() {
        return this.m[0].length;
    }

    /**
     * 矩阵转置
     * @returns {[]}
     */
    transpose() {
        const desArr = [];
        for (let j = 0; j < this.colsNum; j++) {
            desArr[j] = [];
            for (let i = 0; i < this.rowsNum; i++) {
                desArr[j][i] = this.m[i][j];
            }
        }
        return desArr;
    }

}

export {
    Matrix
}